package ace.module.account.api;

import ace.cmp.core.model.R;
import ace.module.account.api.model.auth.dto.AuthenticationResult;
import ace.module.account.api.model.auth.input.AuthenticationInputMap;
import ace.module.account.api.model.auth.input.AuthenticationParams;
import ace.module.account.api.model.auth.input.GenericAuthenticationInput;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;

/**
 * @author Caspar 账户认证API
 */
public interface IamAuthenticationApi {
  /**
   * 账户认证方法
   *
   * @param input     认证参数输入
   * @param <TParams> 每种认证方法的参数
   * @return code=0 success
   */
  <TParams extends AuthenticationParams> R<AuthenticationResult> authentication(
      @Valid @NotNull GenericAuthenticationInput<TParams> input);

  /**
   * 账户认证方法
   *
   * @param input 认证参数输入
   * @return code=0 success
   */
  R<AuthenticationResult> authentication(@Valid @NotNull AuthenticationInputMap input);
}
